package com.csdj.socket_thread;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerSocketDemo {
    public static void main(String[] args) {
        try {
            ServerSocket serverSocket = new ServerSocket(8888);
            while(true){ //负责监听是否发送信息
                Socket socket = serverSocket.accept();
                ServerScoketThread serverScoketThread = new ServerScoketThread(socket);
                Thread thread = new Thread(serverScoketThread);
                thread.start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
